const api = require('../../utils/api.js')
Page({
  data: {

  },
  // 事件处理函数
  toErshouPage() {
    wx.navigateTo({
      url: '../question/question'
    })
  },
  toQuickPage() {
    wx.navigateTo({
      url: '../urgency/urgency'
    })
  },
  
  onLoad() {
    this.getAllPicture()
  },
  onShow(){
    this.getAllPicture()
  },
  onConfirm(e) {
    wx.navigateTo({
      url: '../search/search?key='+e.detail.value,
    })
  },
  getAllPicture(){
    wx.showLoading({
      title: '加载中',
    })
    var that = this
    wx.request({
      url: api.getAllPicture,
      success(res){
        that.setData({
          imgList: res.data.data
        })
        wx.hideLoading()
      }
    })
  },
  onPullDownRefresh(){
    this.getAllPicture()
  }
})
